<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .red {
      color: red;

      display: flex;
      /* -webkit-display: flex;
      -moz-display: flex;
      -o-display: flex;
      -ms-display: flex; */
    }
    .big {
      font-size: 30px;
    }
    .st {
      font-weight: 900;
    }
  </style>
</head>
<body>
  <div id="app">
    <h1>条件渲染</h1>
    <p v-if="num === 123">hello vue!</p>

    <!-- v-else指令必须紧挨着v-if -->
    <h1 v-if="awesome">Vue is awesome!</h1>
    <h1 v-else>Oh no 😢</h1>
    <button v-on:click="awesome = !awesome">btn</button>

    <hr>

    <div v-if="type === 'A'">
      A
    </div>
    <div v-else-if="type === 'B'">
      B
    </div>
    <div v-else-if="type === 'C'">
      C
    </div>
    <div v-else>
      Not A/B/C
    </div>


    <hr>


    <!-- <p v-if="done">123</p>
    <p v-if="done">456</p>
    <p v-if="done">789</p> -->

    <!-- template是一个空的占位标签，在页面里面是不存在的 -->
    <template v-if="done">
      <p>123</p>
      <p>456</p>
      <p>789</p>
    </template>


    <hr>


    <p v-show="show2">hello</p>
  </div>

  <script src="../Vue.js"></script>

  <script>
    const { createApp } = Vue;

    createApp({
      data() {
        return {
          show: false,
          num: 123,
          awesome: false,
          type: "X",
          done: true,
          show2: false
        }
      },
    }).mount("#app")

  </script>
</body>
</html>